//
//  TWorkListVC.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/4/9.
//  Copyright © 2019 李文强. All rights reserved.
//

#import "TWorkListVC.h"
#import "TWCell.h"

@interface TWorkListVC ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation TWorkListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
- (LWQSwichButtonView *)navView{
    if (!_navView) {
        NSMutableArray *array = [NSMutableArray new];
        [array addObject:@"上交详情"];
        [array addObject:@"结果统计"];
        [array addObject:@"作业详情"];
        LWQSwichButtonView *view = [[LWQSwichButtonView alloc]initWithFrame:CGRectMake(0, 0,APP_WIDTH-220-80-20, 44) andArray:array];
        _navView = view;
    }
    return _navView; 
}
- (UIButton *)backButton{
    if (!_backButton) {
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        [button setTitle:@"返回" forState:UIControlStateNormal];
        [button setTitleColor:[UIColorChange colorwithHexString:@"SELECTEDCOLOR"] forState:UIControlStateNormal];
        button addTarget:self action:<#(nonnull SEL)#> forControlEvents:<#(UIControlEvents)#>
        _backButton = button;
    }
}
- (void)initSubView{
    self.view.backgroundColor = MAINBACKCOLOR;
    [self.view addSubview:self.tableList];
    [_tableList mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@0);
        make.right.equalTo(@0).offset(0);
        make.top.equalTo(@44);
        make.bottom.equalTo(@0);
    }];
    
    [self.view addSubview:self.navView];
}
- (void)initOption{
    
}
- (void)layout{
    
}
- (UITableView *)tableList{
    if (!_tableList) {
        UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 0, 0) style:UITableViewStyleGrouped];
        tableView.delegate  =self;
        tableView.dataSource = self;
        [tableView registerClass:[TWCell class] forCellReuseIdentifier:@"TWCell"];
        _tableList = tableView;
    }
    return _tableList;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 10;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 40;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    TWCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TWCell" forIndexPath:indexPath];
    if (!cell) {
        cell = [[TWCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"TWCell"];
    }
    cell.textLabel.text = @"name";
    return cell;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
